package com.heima.wemedia.utils;

import com.heima.model.media.pojos.WmUser;

public class ThreadLocalUtils {
    private static final ThreadLocal<WmUser> ttl = new ThreadLocal<>();

    /**
     * 获取
     * @return
     */
    public static WmUser getUser(){
        return ttl.get();
    }

    /**
     * 设置
     * @param wmUser
     */
    public static void setUser(WmUser wmUser){
        ttl.set(wmUser);
    }

    /**
     * 删除
     */
    public static void delUser(){
        if (getUser()!=null){
            ttl.remove();
        }
    }
}
